#include "zbacktrace.h"

#if ZUTIL_OSTYPE==ZUTIL_ANDROID

#define _GNU_SOURCE
#define _XOPEN_SOURCE

#include <memory.h>
#include <stdlib.h>
#include <stdio.h>
#include <signal.h>
#include <dlfcn.h>

#if defined(REG_RIP)
# define SIGSEGV_STACK_IA64
# define REGFORMAT "%016lx"
#elif defined(REG_EIP)
# define SIGSEGV_STACK_X86
# define REGFORMAT "%08x"
#else
# define SIGSEGV_STACK_GENERIC
# define REGFORMAT "%x"
#endif

static const char * s_corefile = NULL;

static void rendertimer(FILE* fio)
{
	char buf[128];
	struct tm tm;
	time_t sec=time(NULL);
	localtime_r(&sec,&tm);
	strftime(buf, 100,"%Y/%m/%d %H:%M:%S",&tm);
	fprintf(fio,buf);
}
static void signal_segv(int signum, siginfo_t* info, void*ptr)
{
}

/* Obtain a backtrace and print it to stdout. */ 
void zGetBacktrace (char* buf, int maxsize)
{ 
} 

int zEnableBacktrace(const char* cf)
{
}

void zSetBacktraceFile(const char* corefile)
{
	if (corefile)
		s_corefile=corefile;
}
#endif
